package com.southwind.feign;

import com.southwind.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.websocket.server.PathParam;
import java.util.List;

//在注册中心读取接口  这里读取的是user 服务的接口
@FeignClient(value = "user")
public interface UserFeign {
    @GetMapping("/user/findAll/{index}/{limit}")
  public   List<User> findAll(@PathVariable("index") Integer index,@PathVariable("limit") Integer limit);

    @GetMapping("/user/findById/{id}")
    public User findById(@PathVariable("id") Integer id);

    @GetMapping("/user/getUserCount")
    public Integer count();

    @PostMapping("/user/save")
    public  void save( User user);

    @PutMapping("/user/update")
    public  void update( User user);

    @DeleteMapping("/user/deleteById/{id}")
    public void deleteById(@PathVariable("id") Integer id);
}
